<?php
/*
 * @Author: your name
 * @Date: 2021-11-02 20:43:06
 * @LastEditTime: 2021-11-22 14:39:03
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \property\app\Providers\EventServiceProvider.php
 */

namespace App\Providers;

use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
use Illuminate\Database\Events\StatementPrepared;
class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        // //查询出来的对象变为数组
        Event::listen(StatementPrepared::class, function ($event) {
          
            
            $event->statement->setFetchMode(\PDO::FETCH_ASSOC);
        });
       
    }
}
